{%extends "base.html"%}
{% comment %}
Copyright 2010 Lorenzo Benfenati, Andrea Zucchelli"
This file is part of MyMovieCollection.

MyMovieCollection is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3 as published by
the Free Software Foundation.

MyMovieCollection is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with MyMovieCollection. If not, see <http://www.gnu.org/licenses/>
{% endcomment %}
{%block title%}MMC: Pool - {{pool.name}}{%endblock title%}
{%block content%}
{%if pool %}<!-- not a new one -->
		<div class="content">
		<div class="title"> {{pool.name}}</div>
		<div><a href="{%url mytv.views.build_pool pool.id %}">Edit</a></div>
		<div><a href="{%url mytv.views.update_pool pool.id %}">Update Pool</a></div>
		<br/>	
		<div>Description: {{pool.descr}}</div>
		<div>Play mode: {%if pool.playmode == 'R'%}Random{%endif%}{%if pool.playmode == 'S'%}Sequence{%endif%}
  		</div>
		<form method="post" action"">
			{% csrf_token %}
			{%for pe in poolcontent %}
			<div><input type="radio" name="elemetid" value="{{pe.id}}" onclick="$.get('/setlastelement/{{pool.id}}/{{pe.id}}');" {% if pool.lastelementplayed == pe.id %}checked="checked"{% endif %}> N.{{pe.order}}</input> 
			{%if pe.title%}<a href="{%url mymc.views.view_title_html pe.title_id%}">{{pe.title.title}}</a>{%else%}<a href="{%url mymc.views.view_file pe.file_id%}">{{pe.file.filename}}</a>{%endif%}</div>
		{%endfor%} 
	</form>
		</div>  		

{%else%}<!--  new pool -->
		<div>The pool doesn't exists</div>
{%endif%}
{%endblock content%}
